//
//  UIViewController+login.m
//  
//
//  Created by  on 17/2/14.
//  Copyright © 2017年 . All rights reserved.
//
#define Login_Class_Name @"NewLoginViewController"
#import "UIViewController+login.h"

@implementation UIViewController (login)


/**
 退回登录页面之前的页面
 */
-(void)backLoginBeforePage{
    Class class = NSClassFromString(Login_Class_Name);
    if(!class){
        return;
    }
    for (UIViewController *vc in self.navigationController.viewControllers) {
        
        if ([vc isMemberOfClass:class]) {
            [self.navigationController popToViewController:vc animated:NO];
            [vc.navigationController popViewControllerAnimated:NO];
            return;
        }
    }
}

-(void)backViewControllerBeforePage:(NSString *)className{
    Class class = NSClassFromString(className);
    if(!class){
        return;
    }
    for (UIViewController *vc in self.navigationController.viewControllers) {
        
        if ([vc isMemberOfClass:class]) {
            [self.navigationController popToViewController:vc animated:NO];
            [vc.navigationController popViewControllerAnimated:NO];
            return;
        }
    }
}


@end
